package com.br.pfm.persistence.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import lombok.Getter;
import lombok.Setter;

@Entity
@Table(name="PFM_terceiro")
public class Terceiro implements Serializable {
	
	private static final long serialVersionUID = 5709998097085225024L;
	
	@Id
	@GeneratedValue
	@Column(name = "id_terceiro", nullable = false, length = 2)
	private int idTerceiro;
	
	@Getter
    @Setter
	@Column(name = "nm_terceiro", nullable = false, length = 30)
	private String nomeTerceiro;
	
	@Getter
	@Setter
	@OneToMany(cascade=CascadeType.ALL)
    @JoinColumn(name="id_terceiro")
    private List<Pagamento> pagamentos;
	
	@Getter
	@Setter
	@OneToMany(cascade=CascadeType.ALL)
    @JoinColumn(name="id_terceiro")
    private List<ItemFatura> itensFatura;

}
